<?php
final class Application
{
    private $_mode;
    private $_environment;

    private $_router;
    private $_session;
    private $_database;
    private $_template;
    private $_log;

    public function __construct( $mode )
    {
        switch( strtolower($mode) )
        {
            case 'api'  : $this->initMode_Api();    break;
            case 'ajax' : $this->initMode_Ajax();   break;
            case 'web'  : $this->initMode_Web();    break;
        }
    }

    protected function initMode_Api()
    {
        if( $this->_environment == 'maintenance_all'
         || $this->_environment == 'maintenance_api' )
        {
            initMode_Maintenance_Api();
        }
        else
        {

        }
    }

    protected function initMode_Ajax()
    {
        if( $this->_environment == 'maintenance_all'
         || $this->_environment == 'maintenance_web' )
        {
            initMode_Maintenance();
        }
        else
        {

        }
    }

    protected function initMode_Web()
    {
        if( $this->_environment == 'maintenance_all'
         || $this->_environment == 'maintenance_web' )
        {
            initMode_Maintenance();
        }
        else
        {

        }
    }

    protected function initMode_Maintenance()
    {

    }

    protected function initMode_Maintenance_Api()
    {

    }

    public function __destruct()
    {

    }

    public function session()
    {
        return $this->_session;
    }

    public function database()
    {
        return $this->_database;
    }

    public function template()
    {
        return $this->_template;
    }

    public function router()
    {
        return $this->_router;
    }

    public function log()
    {
        return $this->_log;
    }
}
